<?php
/**
 * Short description for base.php
 *
 * @author    tiglog <xq@tiglog.com>
 * @version   0.1
 * @license   MIT
 * @created   2017-08-06
 */

$params = require_once(__DIR__ . '/params.php' );

define('YII_DEBUG', $params['debug']);

$basePath = dirname(dirname(__DIR__));

return [
    'name' => $params['name'],
    'basePath' => $basePath . '/src/app',
    'bootstrap' => ['log'],
    'runtimePath' => $basePath . '/var',
    'vendorPath' => $basePath . '/vendor',
    'aliases' => [
        '@app' => $basePath . '/src/app',
        '@app/web' => $basePath . '/web',
    ],
    'components' => [
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'log' => [
            'targets' => [
                'app'=>[
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                    'logVars' => ['_GET', '_POST', '_FILES'],
                    'categories' => ['application'],
                ],
                'debug' => [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning', 'info'],
                    'logFile' => '@runtime/logs/debug.log',
                    'logVars' => ['_GET', '_POST', '_FILES'],
                    'categories' => ['debug'],
                ],
            ],
        ],
        'user' => [
            'class' => 'yii\web\User',
            'identityClass' => 'app\models\User',
        ],        
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => $params['dbdsn'],
            'username' => $params['dbuser'],
            'password' => $params['dbpass'],
            'tablePrefix' => 'tbl_',
            'charset' => 'UTF-8',
        ],
    ],
    'params' => [
    ],
];

// vim:ft=php:ts=4:sts=4:sw=4:et
